package com.guapi;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync;

@SpringBootApplication()
@EnableAsync
public class Application {

    @Value("${server.servlet.context-path}")
    private static String contextPath;

    @Value("${second-mall.path.domain}")
    private static String domain;

    @Value("${second-mall.path.header}")
    private static String header;

    private static final Logger logger = LoggerFactory.getLogger(Application.class);

    public static void main(String[] args) {
        ApplicationContext application = SpringApplication.run(Application.class, args);
        String domain = application.getEnvironment().getProperty("second-mall.path.domain");
        String contextPath = application.getEnvironment().getProperty("server.servlet.context-path");
        logger.info(
                "\n\n-------------------------------------------------------\n\n\t" +
                "Local访问网址: " + domain + contextPath + "/index\n\n" +
                "-------------------------------------------------------");

    }
}

